<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="project.manager.title"/></title>
<script type="text/javascript" language="javascript" src="<c:url value='/My97DatePicker/WdatePicker.js'/>"></script>
</head>
<body>

	<h1><fmt:message key="project.name"></fmt:message>: ${pm.project }</h1>
	<script type="text/javascript">
	var userCheckboxes = [];
	function _toggle(cball) {
		for (var i = 0; i < userCheckboxes.length; i++)
			document.getElementById(userCheckboxes[i]).checked=cball.checked;
	}
	</script>
	<form:form method="get" commandName="search">
		<fmt:message key="event.info.starttime" />:
		&nbsp;<input id="_startTime" class="Wdate" name="startTime" type="text"
			 value="${startTime }" onfocus="WdatePicker()"/>&nbsp; 
		<fmt:message key="event.info.endtime" />:
		&nbsp;<input id="_endTime" class="Wdate" name="endTime" type="text"
			 value="${endTime }" onfocus="WdatePicker()"/><br>
			 
		<input type="checkbox" id="_all_sub"
			<c:if test="${empty param.userId }">checked="true"</c:if>
			onclick="_toggle(this);"><label for="_all_sub"><fmt:message key="project.manager.all.sub"/></label>
		<c:forEach items="${users }" var="u">
			<c:set value="false" var="selected"></c:set>	
			<c:forEach items="${selectedUserId }" var="su">
				<c:if test="${su == u.id }">
					<c:set value="true" var="selected"></c:set>
				</c:if>
			</c:forEach>
			<script type="text/javascript">userCheckboxes.push("_cb${u.id}")</script>
			<input type="checkbox" class="cbUser" name="userId" id="_cb${u.id }" value="${u.id }" <c:if test="${selected }">checked="${selected }"</c:if>><label for="_cb${u.id }">${u.fullName }</label>
		</c:forEach>
		<input type="submit" value="<fmt:message key='button.query' />"/> 
	</form:form>


	<display:table class="table" name="events" requestURI="/event/projectManager.html" uid="event">
		<display:column property="eventName" url="/event/getEventInfo.html?from=/event/projectManager.html" paramId="id" paramProperty="id" titleKey="event.info.name"></display:column>
		<display:column titleKey="event.info.starttime" sortable="true">${event.startDate }&nbsp;${event.startTime }</display:column>
		<display:column titleKey="event.info.endtime" sortable="true">${event.endTime }</display:column>
		<display:column titleKey="event.info.duration" sortable="true">${event.duration }</display:column>
		<display:column titleKey="event.info.people" sortable="true">${event.user.fullName }</display:column>
		<display:column property="budgetCenter.bcName" titleKey="budget.list.bc.name" sortable="true"></display:column>
	</display:table>
</body>
</html>